package com.dxy.yesas2020goals.study.others.enumlearn.v1;

/**
 * @author victorydeng
 * @Classname SeasonEnum
 * @Description TODO
 * @Date 2020/5/12 9:57
 * @Created by victorydeng
 */
public enum SeasonEnum {
    /*
    春季
     */
    SPRING(0,"春季"),
    /*
    夏季
     */
    SUMMER(1,"夏季"),
    /*
    秋季
     */
    AUTUMN(2,"秋季"),
    /*
    冬季
     */
    WINTER(3,"冬季");
    private Integer value;
    private String name;

    SeasonEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static SeasonEnum getNextSeason(SeasonEnum nowSeason){
        int nextDayValue = nowSeason.value;
        if(nextDayValue == 3){
            nextDayValue = 0;
        } else {
            nextDayValue = nextDayValue+1;
        }
        System.out.println("季节顺序："+nextDayValue+"季节名字："+SeasonEnum.values()[nextDayValue].name);
        return SeasonEnum.values()[nextDayValue];
    }
}
